import React, { useReducer, useEffect } from 'react'
import './App.css';
import FileSearch from './components/search'
import Provider, { reducer, initialState } from './redux/index'
import FileList from './components/FileList'


function App() {
  const [state, dispatch] = useReducer(reducer, initialState);
  useEffect(() => {
    dispatch({ type: 'SELECT_CONTRACT', data: { selsect: 1 } })
  }, [])
  return (
    <Provider store={{ state, dispatch }}>
      <div className="App_index">
        <div className="Left_index">

          <div className="Seach">
            <FileSearch onFileSearch={(value: string) => {
              console.log(value)
            }}></FileSearch>
          </div>
          <div className="list">
            <FileList></FileList>
          </div>
        </div>
        <div className="Right_index">
          <div>
          </div>
        </div>
      </div>
    </Provider>
  );
}

export default App;
